package cn.hls.entity;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.codehaus.jackson.annotate.JsonIgnore;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

/**
  *@fileName: Site.java
  *@package: cn.hls.entity
　*@Description:站点实体类信息
　*@author: yinghui.zhang
　*@email: uuhui@163.com
  *@date: 2016年6月26日
 *
 */
@SuppressWarnings("serial")
@Entity
@Table(name="t_site")
@DynamicInsert
@DynamicUpdate
public class Site extends BaseEntity {
	private String name;//站点名称
	private Company company;//企业
	private Integer type;//站点类型  1－收货站 点  2－发货站点
	private String contractor;//联系人
	private String contractPhone;//联系人电话
	private String contractHomePhone;//联系人家庭电话
	private String contractIdno;//联系人身份证号
	private String contractPhoto;//联系人照片
	private String address;//站点地址
	private Integer status;// 0-暂停 1-正常
	private Long provinceId;// 省份编号
	private String provinceName;// 省份名称
	private Long cityId;// 城市编号
	private String cityName;// 城市名称
	private Long areaId;// 区县编号
	private String areaName;// 区县名称
	private String remark;//备注
	@Column(name="name",length=64)
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	
	@ManyToOne(cascade = CascadeType.REFRESH)
	@NotFound(action = NotFoundAction.IGNORE)
	@JoinColumn(name = "company_id")
	public Company getCompany() {
		return company;
	}
	public void setCompany(Company company) {
		this.company = company;
	}
	@Column(name = "type", length = 1, columnDefinition = "char default 1")
	public Integer getType() {
		return type;
	}
	public void setType(Integer type) {
		this.type = type;
	}
	@Column(name="contractor",length=16)
	public String getContractor() {
		return contractor;
	}
	public void setContractor(String contractor) {
		this.contractor = contractor;
	}
	@Column(name="contract_phone",length=16)
	public String getContractPhone() {
		return contractPhone;
	}
	public void setContractPhone(String contractPhone) {
		this.contractPhone = contractPhone;
	}
	
	@Column(name="contract_home_phone")
	public String getContractHomePhone() {
		return contractHomePhone;
	}
	public void setContractHomePhone(String contractHomePhone) {
		this.contractHomePhone = contractHomePhone;
	}
	@Column(name="contract_idno",length=18)
	public String getContractIdno() {
		return contractIdno;
	}
	public void setContractIdno(String contractIdno) {
		this.contractIdno = contractIdno;
	}
	@Column(name="contract_photo",length=128)
	public String getContractPhoto() {
		return contractPhoto;
	}
	public void setContractPhoto(String contractPhoto) {
		this.contractPhoto = contractPhoto;
	}
	@Column(name="address",length=100)
	public String getAddress() {
		return address;
	}
	public void setAddress(String address) {
		this.address = address;
	}
	@Column(name = "status", length = 1, columnDefinition = "char default 1")
	public Integer getStatus() {
		return status;
	}
	public void setStatus(Integer status) {
		this.status = status;
	}
	
	@Column(name="province_id")
	public Long getProvinceId() {
		return provinceId;
	}

	public void setProvinceId(Long provinceId) {
		this.provinceId = provinceId;
	}

	@Column(name="province_name",length=16)
	public String getProvinceName() {
		return provinceName;
	}

	public void setProvinceName(String provinceName) {
		this.provinceName = provinceName;
	}
	@Column(name="city_id")
	public Long getCityId() {
		return cityId;
	}

	public void setCityId(Long cityId) {
		this.cityId = cityId;
	}

	@Column(name="city_name",length=16)
	public String getCityName() {
		return cityName;
	}

	public void setCityName(String cityName) {
		this.cityName = cityName;
	}
	@Column(name="area_id")
	public Long getAreaId() {
		return areaId;
	}

	public void setAreaId(Long areaId) {
		this.areaId = areaId;
	}

	@Column(name="area_name",length=16)
	public String getAreaName() {
		return areaName;
	}

	public void setAreaName(String areaName) {
		this.areaName = areaName;
	}

	@JsonIgnore
	@Column(name="remark",length=100)
	public String getRemark() {
		return remark;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
	
	
	
	
}
